#define MY_ENUM(x) log##x,
enum flags {
#include "flags.inc"
};
#undef MY_ENUM

#define MY_ENUM(x) #x,
char *flag_names[] = {
#include "flags.inc"
};
#undef MY_ENUM

#include <iostream>

int main() {
    std::cout << "first enum has value " << logapple << " and name " << flag_names[logapple] << "\n";
    std::cout << "first enum has value " << logbanana << " and name " << flag_names[logbanana] << "\n";
}

